//
//  FootViewShop.m
//  shanHaiHuiApp
//
//  Created by DS on 2018/3/14.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "FootViewShop.h"
@interface FootViewShop()<UITextViewDelegate>


Strong UILabel * chooseStoreLabel;
Strong UILabel * remarkLabel;

Strong UIView * lineView;

Strong NSString * placeHoler;

@end
@implementation FootViewShop

#pragma Action--
- (void)chooseBtnClick{
    
    if (_getChooseBtnClick) {
        _getChooseBtnClick();
    }
}



//-(BOOL)textView:(UITextView *)textView
//shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
//
//    NSString *content = text;
//
//
//    if (_getRemarkClick) {
//        _getRemarkClick();
//    }
//
//    self.remarkText = content;
//
//    return YES;
//    
//}


#pragma init--
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
      
        
        _chooseStoreLabel = [[UILabel alloc] init];
        _chooseStoreLabel.text = @"选择门店：";
        _chooseStoreLabel.font = DEF_FontSize_13;
        _chooseStoreLabel.textColor = getColor(@"6A6A6A");
        
        _chooseBtn = [[UIButton alloc] init];
        [_chooseBtn setTitle:@"==请选择门店==" forState:UIControlStateNormal];
        [_chooseBtn setTitleColor:getColor(@"323232") forState:UIControlStateNormal];
        _chooseBtn.titleLabel.font = DEF_FontSize_13;
        [_chooseBtn addTarget:self action:@selector(chooseBtnClick) forControlEvents:UIControlEventTouchUpInside];
        
        _remarkLabel = [[UILabel alloc] init];
        _remarkLabel.font = DEF_FontSize_13;
        _remarkLabel.textColor = getColor(@"6A6A6A");
        _remarkLabel.text = @"配送备注：";
        
        _remarkView = [[UITextView alloc] init];
        _remarkView.font = DEF_FontSize_13;
        _remarkView.textColor = getColor(dividerColor);
        _remarkView.layer.borderColor = getColor(dividerColor).CGColor;
        _remarkView.layer.borderWidth = 1;
        _remarkView.delegate = self;
        
        
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = getColor(dividerColor);
        
        [self sd_addSubviews:@[self.chooseStoreLabel,self.chooseBtn,self.remarkLabel,self.remarkView,self.lineView]];
        
        [self layOutFrame];
    }
    return self;
}

- (void)layOutFrame{
    ws(self)
    [self.chooseStoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(UNIT_HEIGHT(15));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.chooseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(UNIT_HEIGHT(15));
        make.left.mas_equalTo(weakself.chooseStoreLabel.mas_right).offset(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.chooseStoreLabel.mas_bottom).offset(15);
        make.left.mas_equalTo(UNIT_WIDTH(0));
        make.height.mas_equalTo(UNIT_HEIGHT(0.5));
        make.right.mas_equalTo(0);
    }];
    
    [self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.lineView.mas_bottom).offset(UNIT_HEIGHT(15));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.remarkView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.remarkLabel.mas_bottom).offset(UNIT_HEIGHT(15));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.right.mas_equalTo(UNIT_WIDTH(-15));
        make.height.mas_equalTo(UNIT_HEIGHT(100));
    }];
}

@end
